git-annex.git
3 years agoavoid flushing keys db queue after each Annex action
Joey Hess [Wed, 12 Oct 2022 17:50:46 +0000 (13:50 -0400)]
avoid flushing keys db queue after each Annex action

The flush was only done Annex.run' to make sure that the queue was flushed
before git-annex exits. But, doing it there means that as soon as one
change gets queued, it gets flushed soon after, which contributes to
excessive writes to the database, slowing git-annex down.
(This does not yet speed git-annex up, but it is a stepping stone to
doing so.)

Database queues do not autoflush when garbage collected, so have to
be flushed explicitly. I don't think it's possible to make them
autoflush (except perhaps if git-annex sqitched to using ResourceT..).
The comment in Database.Keys.closeDb used to be accurate, since the
automatic flushing did mean that all writes reached the database even
when closeDb was not called. But now, closeDb or flushDb needs to be
called before stopping using an Annex state. So, removed that comment.

In Remote.Git, change to using quiesce everywhere that it used to use
stopCoProcesses. This means that uses on onLocal in there are just as
slow as before. I considered only calling closeDb on the local git remotes
when git-annex exits. But, the reason that Remote.Git calls stopCoProcesses
in each onLocal is so as not to leave git processes running that have files
open on the remote repo, when it's on removable media. So, it seemed to make
sense to also closeDb after each one, since sqlite may also keep files
open. Although that has not seemed to cause problems with removable
media so far. It was also just easier to quiesce in each onLocal than
once at the end. This does likely leave performance on the floor, so
could be revisited.

In Annex.Content.saveState, there was no reason to close the db,
flushing it is enough.

The rest of the changes are from auditing for Annex.new, and making
sure that quiesce is called, after any action that might possibly need
it.

After that audit, I'm pretty sure that the change to Annex.run' is
safe. The only concern might be that this does let more changes get
queued for write to the db, and if git-annex is interrupted, those will be
lost. But interrupting git-annex can obviously already prevent it from
writing the most recent change to the db, so it must recover from such
lost data... right?

Sponsored-by: Dartmouth College's Datalad project
3 years agoupdate
Joey Hess [Tue, 11 Oct 2022 19:02:40 +0000 (15:02 -0400)]
update

3 years agoall keys are still present on versioned remote after import of a tree
Joey Hess [Tue, 11 Oct 2022 17:04:33 +0000 (13:04 -0400)]
all keys are still present on versioned remote after import of a tree

When importing from versioned remotes, fix tracking of the content of
deleted files.

Only S3 supports versioning so far, so only it was affected.

But, the draft import/export interface for external remotes also seemed to
need a change, so that versionedExport could be set.

3 years ago(no commit message)
benjamin.poldrack@d09ccff6d42dd20277610b59867cf7462927b8e3 [Tue, 11 Oct 2022 09:12:00 +0000 (09:12 +0000)]

3 years agoS3: pass fileprefix into getBucket calls
Joey Hess [Mon, 10 Oct 2022 21:37:26 +0000 (17:37 -0400)]
S3: pass fileprefix into getBucket calls

S3: Speed up importing from a large bucket when fileprefix= is set by only
asking for files under the prefix.

getBucket still returns the files with the prefix included, so the rest of
the fileprefix stripping still works unchanged.

Sponsored-by: Dartmouth College's DANDI project
3 years agofuture proof AWS.Credentials generation
Joey Hess [Mon, 10 Oct 2022 20:31:08 +0000 (16:31 -0400)]
future proof AWS.Credentials generation

Avoid breaking when a field is added to the constructor.

Sponsored-by: Dartmouth College's DANDI project
3 years agotake lock in checkLogFile and calcLogFile
Joey Hess [Fri, 7 Oct 2022 17:19:17 +0000 (13:19 -0400)]
take lock in checkLogFile and calcLogFile

move: Fix openFile crash with -J

This does make them a bit slower, although usually the log file is not
very big, so even when it's being rewritten, they will not block for
long taking the lock. Still, little slowdowns may add up when moving a lot
file files.

A less expensive fix would be to use something lower level than openFile
that does not check if the file is already open for write by another
thread. But GHC does not seem to provide anything convenient; even mkFD
checks for a writing thread.

fullLines is no longer necessary since these functions no longer will
read the file while it's being written.

Sponsored-by: Dartmouth College's DANDI project
3 years agofix typo
Joey Hess [Fri, 7 Oct 2022 16:30:07 +0000 (12:30 -0400)]
fix typo

3 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Fri, 7 Oct 2022 16:29:32 +0000 (12:29 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

3 years agoAdded a comment
jkniiv [Thu, 6 Oct 2022 16:04:41 +0000 (16:04 +0000)]
Added a comment

3 years agoAdded a comment
yarikoptic [Thu, 6 Oct 2022 12:50:01 +0000 (12:50 +0000)]
Added a comment

3 years agoremoved
yarikoptic [Thu, 6 Oct 2022 12:47:48 +0000 (12:47 +0000)]
removed

3 years agoAdded a comment
yarikoptic [Thu, 6 Oct 2022 12:47:17 +0000 (12:47 +0000)]
Added a comment

3 years agoAdded a comment
jkniiv [Thu, 6 Oct 2022 06:21:40 +0000 (06:21 +0000)]
Added a comment

3 years ago(no commit message)
yarikoptic [Thu, 6 Oct 2022 01:37:24 +0000 (01:37 +0000)]

3 years agoinitial report on locking issue on move
yarikoptic [Wed, 5 Oct 2022 21:25:00 +0000 (21:25 +0000)]
initial report on locking issue on move

3 years agoupdate
Joey Hess [Wed, 5 Oct 2022 17:01:12 +0000 (13:01 -0400)]
update

3 years agoAdded a comment
jules@a6ba859eba6f59bd980f294741b1ad9b7624552a [Tue, 4 Oct 2022 17:59:54 +0000 (17:59 +0000)]
Added a comment

3 years agocomments
Joey Hess [Tue, 4 Oct 2022 17:36:38 +0000 (13:36 -0400)]
comments

3 years agoadd missing whitespace in warning message
Joey Hess [Tue, 4 Oct 2022 17:30:22 +0000 (13:30 -0400)]
add missing whitespace in warning message

3 years agocomment
Joey Hess [Tue, 4 Oct 2022 17:06:55 +0000 (13:06 -0400)]
comment

3 years agoimprove usage
Joey Hess [Mon, 3 Oct 2022 17:49:42 +0000 (13:49 -0400)]
improve usage

These commands operate on not only remotes, but any way a repository can
be specified, including "here" etc.

Sponsored-by: Graham Spencer on Patreon
3 years agoavoid combining multiple words provided to trust/untrust/dead
Joey Hess [Mon, 3 Oct 2022 17:48:40 +0000 (13:48 -0400)]
avoid combining multiple words provided to trust/untrust/dead

* trust, untrust, semitrust, dead: Fix behavior when provided with
  multiple repositories to operate on.
* trust, untrust, semitrust, dead: When provided with no parameters,
  do not operate on a repository that has an empty name.

The man page and usage already indicated that multiple repos could be
provided to these commands, but they actually used unwords to combine
everything into string, and found a repo matching that string. This was
especially bad when no parameters resulted in the empty string and some
repo happened to have an empty description.

This does change the behavior, and it's possible someone relied on the
current behavior to eg, trust a repo by name with the name not quoted into
a single parameter. But fixing the empty string bug and matching the
documentation are worth breaking that usage.

Note that git-annex init/reinit do still unwords multiple parameters when
provided to them. That is inconsistent behavior, but it certianly seems
possible that something does run git-annex init with an unquoted
description, and I don't think it's worth breaking that just to make it more
consistent with these other commands.

Sponsored-by: Boyd Stephen Smith Jr. on Patreon
3 years agoimprove wording
Joey Hess [Mon, 3 Oct 2022 17:32:55 +0000 (13:32 -0400)]
improve wording

This is to improve this case:

joey@darkstar:~/tmp/yyyy>git-annex trust
git-annex: no remote specified

The command does not need to be run with a remote, any repository name
will do, including eg "here".

Sponsored-by: Brock Spratlen on Patreon
3 years agoadd news item for git-annex 10.20221003
Joey Hess [Mon, 3 Oct 2022 17:24:33 +0000 (13:24 -0400)]
add news item for git-annex 10.20221003

3 years agoreleasing package git-annex version 10.20221003
Joey Hess [Mon, 3 Oct 2022 17:24:21 +0000 (13:24 -0400)]
releasing package git-annex version 10.20221003

3 years agochange name of option
Joey Hess [Mon, 3 Oct 2022 17:02:11 +0000 (13:02 -0400)]
change name of option

See https://bugs.debian.org/885987

3 years agobug report
Joey Hess [Mon, 3 Oct 2022 17:00:29 +0000 (13:00 -0400)]
bug report

3 years agoAdded a comment
jkniiv [Sat, 1 Oct 2022 08:23:43 +0000 (08:23 +0000)]
Added a comment

3 years agoAdded a comment: restage.log was empty indeed
jkniiv [Sat, 1 Oct 2022 05:14:17 +0000 (05:14 +0000)]
Added a comment: restage.log was empty indeed

3 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Fri, 30 Sep 2022 18:04:40 +0000 (14:04 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

3 years agoadd comments
Joey Hess [Fri, 30 Sep 2022 18:04:33 +0000 (14:04 -0400)]
add comments

3 years agoapplied a patch
Joey Hess [Fri, 30 Sep 2022 18:04:10 +0000 (14:04 -0400)]
applied a patch

3 years ago(no commit message)
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Fri, 30 Sep 2022 18:03:50 +0000 (18:03 +0000)]

3 years agoFix annex.adviceNoSshCaching having no effect
Reiko Asakura [Fri, 30 Sep 2022 14:56:17 +0000 (10:56 -0400)]
Fix annex.adviceNoSshCaching having no effect

git will always return option names in lowercase

3 years agofix flush of a closed file handle
Joey Hess [Fri, 30 Sep 2022 18:02:31 +0000 (14:02 -0400)]
fix flush of a closed file handle

Avoids displaying warning about git-annex restage needing to be run in
situations where it does not.

Closing a handle flushes it anyway, so no need for an explict flush. The
handle does get closed twice, but that's fine, the second one does nothing.

Sponsored-by: Dartmouth College's DANDI project
3 years agocomment
Joey Hess [Fri, 30 Sep 2022 17:42:30 +0000 (13:42 -0400)]
comment

3 years agoupdate in response to comment
Joey Hess [Fri, 30 Sep 2022 17:33:59 +0000 (13:33 -0400)]
update in response to comment

3 years agocomment
Joey Hess [Fri, 30 Sep 2022 17:25:54 +0000 (13:25 -0400)]
comment

3 years ago(no commit message)
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Fri, 30 Sep 2022 15:41:51 +0000 (15:41 +0000)]

3 years agoreporting that we're now in some cases needlessly reminded to run `restage`
jkniiv [Fri, 30 Sep 2022 13:40:01 +0000 (13:40 +0000)]
reporting that we're now in some cases needlessly reminded to run `restage`

3 years agoAdded a comment: mess up commited to my branch
jules@a6ba859eba6f59bd980f294741b1ad9b7624552a [Thu, 29 Sep 2022 09:26:06 +0000 (09:26 +0000)]
Added a comment: mess up commited to my branch

3 years ago(no commit message)
jules@a6ba859eba6f59bd980f294741b1ad9b7624552a [Thu, 29 Sep 2022 08:44:16 +0000 (08:44 +0000)]

3 years agoAdded a comment
kdm9 [Wed, 28 Sep 2022 12:55:49 +0000 (12:55 +0000)]
Added a comment

3 years agoAdded a comment: DIRHASH ending in slash?
jeroen [Wed, 28 Sep 2022 11:58:57 +0000 (11:58 +0000)]
Added a comment: DIRHASH ending in slash?

3 years agoAdded a comment
pat [Wed, 28 Sep 2022 08:40:11 +0000 (08:40 +0000)]
Added a comment

3 years agoAdded a comment
pat [Wed, 28 Sep 2022 07:43:28 +0000 (07:43 +0000)]
Added a comment

3 years agocomment
Joey Hess [Tue, 27 Sep 2022 19:01:08 +0000 (15:01 -0400)]
comment

3 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Tue, 27 Sep 2022 18:58:02 +0000 (14:58 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

3 years agocomment
Joey Hess [Tue, 27 Sep 2022 18:57:56 +0000 (14:57 -0400)]
comment

3 years agoAdded a comment
kdm9 [Tue, 27 Sep 2022 18:40:40 +0000 (18:40 +0000)]
Added a comment

3 years agocomment
Joey Hess [Tue, 27 Sep 2022 18:31:06 +0000 (14:31 -0400)]
comment

3 years agoAdded a comment
kdm9 [Tue, 27 Sep 2022 17:49:53 +0000 (17:49 +0000)]
Added a comment

3 years agov10nfs-bug
kdm9 [Tue, 27 Sep 2022 17:48:02 +0000 (17:48 +0000)]
v10nfs-bug

3 years agoadd news item for git-annex 10.20220927
Joey Hess [Tue, 27 Sep 2022 17:32:09 +0000 (13:32 -0400)]
add news item for git-annex 10.20220927

3 years agoreleasing package git-annex version 10.20220927
Joey Hess [Tue, 27 Sep 2022 17:31:55 +0000 (13:31 -0400)]
releasing package git-annex version 10.20220927

3 years agoremove link to closed todo
Joey Hess [Tue, 27 Sep 2022 17:30:39 +0000 (13:30 -0400)]
remove link to closed todo

Not that it was actually fixed, but ..

3 years ago(no commit message)
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Tue, 27 Sep 2022 00:45:22 +0000 (00:45 +0000)]

3 years agoavoid name shadowing warning
Joey Hess [Mon, 26 Sep 2022 20:20:56 +0000 (16:20 -0400)]
avoid name shadowing warning

3 years agoSupport "inbackend" in preferred content expressions
Joey Hess [Mon, 26 Sep 2022 20:06:49 +0000 (16:06 -0400)]
Support "inbackend" in preferred content expressions

Well, actually, fix a typo that has always been in the implementation of
that. "inbacked" used to work, but let's not tell users about that; they
might try to use it and expect git-annex to keep supporting the typo..

Sponsored-by: Jack Hill on Patreon
3 years agoadd comment
Joey Hess [Mon, 26 Sep 2022 20:05:46 +0000 (16:05 -0400)]
add comment

3 years agoimprove documentation about backends
Joey Hess [Mon, 26 Sep 2022 19:59:10 +0000 (15:59 -0400)]
improve documentation about backends

I noticed that, using just the man pages, there is no real description
of what backends are, or what ones are available. Except for some
examples.

Added a git-annex-backends man page, that is just a stub, but at least
describes what they basically are, and tells how to find the supported
ons, and links to the backends web page.

Sponsored-by: Brett Eisenberg on Patreon
3 years agofix breakage in wormhole's sendFile
Joey Hess [Mon, 26 Sep 2022 19:26:29 +0000 (15:26 -0400)]
fix breakage in wormhole's sendFile

Commit ff0927bde98e7b7fd4a7ef49b61b8770c6df294d broke this, it made it
try to read all of the input before looking for the code. But, wormhole
keeps running until it sends the file, so that caused a deadlock. Oops.

Sponsored-by: Luke Shumaker on Patreon
3 years agofix wormhole --appid option position
Joey Hess [Mon, 26 Sep 2022 19:11:38 +0000 (15:11 -0400)]
fix wormhole --appid option position

p2p: Pass wormhole the --appid option before the receive/send command, as
it does not accept that option after the command

I'm left wondering, did I get this wrong from the beginning, or did
wormhole change its option parser? I'm reminded of the change in 0.8.2
where it silently changed what FD the pairing code was output to.
But, looking at the wormhole source, it was at least putting --appid before
send in its test suite from the introduction of the option.

So I think probably this has always been broken. On 2021-12-31 the --appid
option was enabled, and it took until now for someone to try
git-annex p2p --pair and notice that flag day broke it..

Sponsored-by: Svenne Krap on Patreon
3 years agoenable-tor: Fix breakage caused by git's fix for CVE-2022-24765
Joey Hess [Mon, 26 Sep 2022 18:48:58 +0000 (14:48 -0400)]
enable-tor: Fix breakage caused by git's fix for CVE-2022-24765

This relies on bfa451fc4e621700883fb3b34600bdf71f515a62 and is a bit of an
ugly hack.

Sponsored-by: Noam Kremen on Patreon
3 years agopass --git-dir when reading git config when it was specified explicitly
Joey Hess [Mon, 26 Sep 2022 18:38:34 +0000 (14:38 -0400)]
pass --git-dir when reading git config when it was specified explicitly

Let GIT_DIR and --git-dir override git's protection against operating in a
repository owned by another user.

This is the same behavior other git commands have.

Sponsored-by: Jarkko Kniivilä on Patreon
3 years agoRevert "fix comment"
Joey Hess [Mon, 26 Sep 2022 17:39:10 +0000 (13:39 -0400)]
Revert "fix comment"

This reverts commit c39b057b2daa3280c045d56d60b2c91a99a9c31b.

3 years agofix comment
Joey Hess [Mon, 26 Sep 2022 17:37:47 +0000 (13:37 -0400)]
fix comment

3 years agocomment
Joey Hess [Mon, 26 Sep 2022 17:25:04 +0000 (13:25 -0400)]
comment

3 years agocomment
Joey Hess [Mon, 26 Sep 2022 17:23:04 +0000 (13:23 -0400)]
comment

3 years agochangelog and close
Joey Hess [Mon, 26 Sep 2022 17:11:23 +0000 (13:11 -0400)]
changelog and close

3 years agonote that hooks are also run when on a crippled filesystem now
Joey Hess [Mon, 26 Sep 2022 17:10:47 +0000 (13:10 -0400)]
note that hooks are also run when on a crippled filesystem now

3 years agoremove unncessary do block
Joey Hess [Mon, 26 Sep 2022 17:10:25 +0000 (13:10 -0400)]
remove unncessary do block

Left by Reiko's patch

3 years agoRun freeze and thaw hooks on crippled filesystems
Reiko Asakura [Sun, 25 Sep 2022 19:21:24 +0000 (15:21 -0400)]
Run freeze and thaw hooks on crippled filesystems

The user sets these hooks deliberately so they should always be run. For
example this allows hooks to be used to manage file permissions on NTFS
volumes in WSL1.

3 years agohandle upgrading repositories initialized with --version=9
Joey Hess [Mon, 26 Sep 2022 16:55:51 +0000 (12:55 -0400)]
handle upgrading repositories initialized with --version=9

As was attempted earlier in the buggy commit 0d2e3058ee01d55dc3b929ddf8e0573a95a2ca85

Avoided the bug that had by making the upgrade log be updated after each
upgrade step. So, after upgrade from v8 to v9, the log is updated, and
so Upgrade.V9's timeOfUpgrade check will find that it was upgraded
recently and so won't let it skip ahead to v10.

Sponsored-by: k0ld on Patreon
3 years agochangelog for problem fixed by earlier revert
Joey Hess [Mon, 26 Sep 2022 16:27:32 +0000 (12:27 -0400)]
changelog for problem fixed by earlier revert

3 years agocomment
Joey Hess [Mon, 26 Sep 2022 16:18:41 +0000 (12:18 -0400)]
comment

3 years agoRevert "handle upgrading repositories initialized with --version=9"
Joey Hess [Mon, 26 Sep 2022 16:17:50 +0000 (12:17 -0400)]
Revert "handle upgrading repositories initialized with --version=9"

This reverts commit 0d2e3058ee01d55dc3b929ddf8e0573a95a2ca85.

This commit accidentially caused repos that were initialized at v8 to
also upgrade to v10. There is nothing in the upgrade.log for such a
repo..

3 years agofix windows build
Joey Hess [Mon, 26 Sep 2022 16:08:04 +0000 (12:08 -0400)]
fix windows build

3 years agoMerge branch 'master' of ssh://git-annex.branchable.com
Joey Hess [Mon, 26 Sep 2022 16:07:46 +0000 (12:07 -0400)]
Merge branch 'master' of ssh://git-annex.branchable.com

3 years agoreport on windows FTBFS
yarikoptic [Mon, 26 Sep 2022 15:47:23 +0000 (15:47 +0000)]
report on windows FTBFS

3 years agoAdded a comment
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sun, 25 Sep 2022 19:43:31 +0000 (19:43 +0000)]
Added a comment

3 years ago(no commit message)
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sun, 25 Sep 2022 19:39:22 +0000 (19:39 +0000)]

3 years ago(no commit message)
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sun, 25 Sep 2022 02:01:26 +0000 (02:01 +0000)]

3 years ago(no commit message)
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sat, 24 Sep 2022 23:28:09 +0000 (23:28 +0000)]

3 years agoFix some markdown formatting problems
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sat, 24 Sep 2022 23:27:17 +0000 (23:27 +0000)]
Fix some markdown formatting problems

3 years agoAdd patches for WSL1
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sat, 24 Sep 2022 23:23:40 +0000 (23:23 +0000)]
Add patches for WSL1

3 years agoFix WSL1 instructions
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sat, 24 Sep 2022 22:31:54 +0000 (22:31 +0000)]
Fix WSL1 instructions

3 years agoclose bug "git commit smudges unncessarily"
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sat, 24 Sep 2022 20:37:56 +0000 (20:37 +0000)]
close bug "git commit smudges unncessarily"

3 years agoAdded a comment
asakurareiko@f3d908c71c009580228b264f63f21c7274df7476 [Sat, 24 Sep 2022 19:43:47 +0000 (19:43 +0000)]
Added a comment

3 years ago(no commit message)
dukeofcool199 [Sat, 24 Sep 2022 19:24:19 +0000 (19:24 +0000)]

3 years ago(no commit message)
dukeofcool199 [Sat, 24 Sep 2022 19:21:09 +0000 (19:21 +0000)]

3 years agorefector for legibility
Joey Hess [Fri, 23 Sep 2022 22:53:06 +0000 (18:53 -0400)]
refector for legibility

3 years agorestage: New git-annex command, handles restaging unlocked files
Joey Hess [Fri, 23 Sep 2022 20:29:28 +0000 (16:29 -0400)]
restage: New git-annex command, handles restaging unlocked files

This is much easier and less failure-prone than having the user run
git update-index --refresh themselves.

Sponsored-by: Dartmouth College's DANDI project
3 years agofix restaging of transferred files after stalldetection kicks in
Joey Hess [Fri, 23 Sep 2022 19:55:40 +0000 (15:55 -0400)]
fix restaging of transferred files after stalldetection kicks in

Sponsored-by: Dartmouth College's DANDI project
3 years agoadd restage log
Joey Hess [Fri, 23 Sep 2022 18:38:59 +0000 (14:38 -0400)]
add restage log

When pointer files need to be restaged, they're first written to the
log, and then when the restage operation runs, it reads the log. This
way, if the git-annex process is interrupted before it can do the
restaging, a later git-annex process can do it.

Currently, this lets a git-annex get/drop command be interrupted and
then re-ran, and as long as it gets/drops additional files, it will
clean up after the interrupted command. But more changes are
needed to make it easier to restage after an interrupted process.

Kept using the git queue to run the restage action, even though the
list of files that it builds up for that action is not actually used by
the action. This could perhaps be simplified to make restaging a cleanup
action that gets registered, rather than using the git queue for it. But
I wasn't sure if that would cause visible behavior changes, when eg
dropping a large number of files, currently the git queue flushes
periodically, and so it restages incrementally, rather than all at the
end.

In restagePointerFiles, it reads the restage log twice, once to get
the number of files and size, and a second time to process it.
This seemed better than reading the whole file into memory, since
potentially a huge number of files could be in there. Probably the OS
will cache the file in memory and there will not be much performance
impact. It might be better to keep running tallies in another file
though. But updating that atomically with the log seems hard.

Also note that it's possible for calcRestageLog to see a different file
than streamRestageLog does. More files may be added to the log in
between. That is ok, it will only cause the filterprocessfaster heuristic to
operate with slightly out of date information, so it may make the wrong
choice for the files that got added and be a little slower than ideal.

Sponsored-by: Dartmouth College's DANDI project
3 years agogeneralize refreshIndex to MonadIO
Joey Hess [Fri, 23 Sep 2022 18:28:52 +0000 (14:28 -0400)]
generalize refreshIndex to MonadIO

Sponsored-by: Dartmouth College's DANDI project
3 years agoavoid unncessary locking by checkLogFile
Joey Hess [Fri, 23 Sep 2022 18:01:43 +0000 (14:01 -0400)]
avoid unncessary locking by checkLogFile

Like the comment says, this works without locking. It looks like I
originally copied another function and forgot to remove the locking.

Sponsored-by: Dartmouth College's DANDI project
3 years agoadd a finalizer to streamLogFile
Joey Hess [Fri, 23 Sep 2022 17:49:01 +0000 (13:49 -0400)]
add a finalizer to streamLogFile

Sponsored-by: Dartmouth College's DANDI project
3 years agorefactor the restage runner
Joey Hess [Fri, 23 Sep 2022 17:10:49 +0000 (13:10 -0400)]
refactor the restage runner

Sponsored-by: Dartmouth College's DANDI project